# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=badkarma
pkgver=85.2c46334
pkgrel=10
pkgdesc='Advanced network reconnaissance toolkit.'
groups=('blackarch' 'blackarch-recon' 'blackarch-scanner'
        'blackarch-networking')
arch=('any')
url='https://github.com/r3vn/badKarma'
license=('GPL3')
depends=('python' 'python-python-libnmap' 'python-sqlalchemy' 'phantomjs'
         'ffmpeg' 'gtksourceview3' 'osm-gps-map' 'python-gobject' 'mitmproxy'
         'python-shodan' 'vte3' 'webkit2gtk')
makedepends=('git')
source=("$pkgname::git+https://github.com/r3vn/badKarma.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" readme.md
  install -Dm 644 license.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm *.md

  cp -a * "$pkgdir/usr/share/$pkgname"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python $pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

